﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CMS;
namespace CMS.Class
{
    public class clsComBoBox
    {
        public clsComBoBox() { 
        }
        private static String _strQpWeb = Constant.Connec;
        private QpWebConnec.QpConnec cls = null;

        public void LoadComBoBox(DropDownList cbb, String sql, String DataTextField, String DataValueField)
        {
            cls = new QpWebConnec.QpConnec(_strQpWeb);
            DataTable m_tb = cls.GetData(sql, CommandType.Text);
            cbb.DataSource = m_tb;
            cbb.DataTextField = DataTextField;
            cbb.DataValueField = DataValueField;
            cbb.DataBind();
        }

    }
}